<?php
    
    $this->headLink()->appendStylesheet($this->baseUrl() . 'css/liveraid.css');
    $this->headScript()->appendFile($this->baseUrl() . 'js/pldkp/LiveRaid.js');

?>

<?php 
    foreach ($this->dungeons as $dungeon) {
        $dungeonList[] = $dungeon->id . ": {\"name\": \"".$dungeon->name."\"}";
    }
?>
<script type="text/javascript">

function initialize()
{
    var options = {
    	"raid" : <?= $this->raid->id ?>,
        "containers" : { 
            "roster" : $("#container_roster_start"),
            "events" : $("#container_raid_events"),
            "raid"   : $("#container_raid_information")
        },
        "events" : {
            "leave" : {
                0: {"text": "No penality", "spent": 0, "standard" : true},
                5: {"text": "Leaving early", "spent": 2},
                7: {"text": "No show", "spent": 5}
            },
            "kill" : { 
                8: {"text": "Farm kill", "earned": 1, "standard" : true}, 
                9: {"text": "Progress kill", "earned": 2},
               10: {"text": "First time kill", "earned": 4}
            }
        },
        "dungeons" : { 
            <?= implode(",", $dungeonList)."\n" ?>
        },
        "actions" : {
            "addJoin"              : "<?= $this->url(array('controller'=>'liveraid', "action" => "add-join")) ?>",
            "addLeave"             : "<?= $this->url(array('controller'=>'liveraid', "action" => "add-leave")) ?>",
            "addDungeonChange"     : "<?= $this->url(array('controller'=>'liveraid', "action" => "add-dungeon-change")) ?>",
            "addKill"              : "<?= $this->url(array('controller'=>'liveraid', "action" => "add-kill")) ?>",
            "addDrop"              : "<?= $this->url(array('controller'=>'liveraid', "action" => "add-drop")) ?>",
            "removeJoin"           : "<?= $this->url(array('controller'=>'liveraid', "action" => "remove-join")) ?>",
            "removeLeave"          : "<?= $this->url(array('controller'=>'liveraid', "action" => "remove-leave")) ?>",
            "removeDungeonChange"  : "<?= $this->url(array('controller'=>'liveraid', "action" => "remove-dungeon-change")) ?>",
            "removeKill"           : "<?= $this->url(array('controller'=>'liveraid', "action" => "remove-kill")) ?>",
            "removeDrop"           : "<?= $this->url(array('controller'=>'liveraid', "action" => "remove-drop")) ?>",
            "getAliveBosses"       : "<?= $this->url(array('controller'=>'liveraid', "action" => "get-alive-bosses")) ?>",
            "getRaidEvents"        : "<?= $this->url(array('controller'=>'liveraid', "action" => "get-raid-events")) ?>",
            "getCharactersInRaid"  : "<?= $this->url(array('controller'=>'liveraid', 'action'=>'get-characters-in-raid')) ?>",
            "getRaidInformation"   : "<?= $this->url(array('controller'=>'raids', 'action'=>'get-raid-info')) ?>",
            "getBossItems"         : "<?= $this->url(array('controller'=>'liveraid', 'action'=>'get-boss-items')) ?>",
            "evaluateBidders"      : "<?= $this->url(array('controller'=>'dkp', 'action'=>'evaluate-bidders')) ?>",
            "getCharactersBuyPower": "<?= $this->url(array('controller'=>'dkp', 'action'=>'get-characters-buy-power')) ?>"
        }
    };

    var liveRaid = new LiveRaid(options);
    liveRaid.initialize();
}

$(document).ready( function() {
    initialize();
});

</script>

<div class="content-left">
    <h1><?= $this->img("/images/icons/INV_Bijou_Gold.jpg") ?> Initial raid group</h1>
    <div id="container_roster_start"></div>
</div>

<div class="content-right">
    <h1><?= $this->img("/images/icons/INV_Bijou_Gold.jpg") ?> Raid information</h1>
    <div id="container_raid_information">
    </div>
</div>

<div class="content-full">
    <h1><?= $this->img("/images/icons/INV_Bijou_Gold.jpg") ?> Raid events</h1>
    <div id="container_raid_events"></div>
</div>
